
*************************************/
* skip95.do
* Empirical Analsysis for: * Crossley, T.F., and H. Low, �Job Loss, Credit Constraints and Consumption Growth.� Review of Economics and Statistics, 96(5):876-884 (December, 2014.) 
* Contact: tfcrossley@gmail.com or tcross@esex.ac.uk
* this program Unwinds stat canada skips.
* this program is called by cl_data.do.
* last revised 2014
* *************************************/ ;
#delimit;
* set more 1;
*************************************/ ;
* current self employment;
replace cslfemp1=3 if sslfemp1==0&rslfemp1==0;
replace cslfema2=3 if sslfema2==0;
replace cslfemb2=3 if sslfemb2==0;

*************************************/ ;
* current employment;


*************************************/ ;
* expect ROE job end;

replace QB41=1 if rqreas1==2;

* expected job end if quit due to expectation of layoff;

*************************************/ ;
* ROE advanced notice;

* (no formal advanced notice if didnt expect job to end);

replace QB71=0 if QB41==0;

*************************************/ ;
*family variables;

sum chhsize1 cspouse1 cparnts1 cothers1 cchldrn1;

replace cspouse1=0 if cspouse1==. & chhsize1==1;
replace cparnts1=0 if cparnts1==. & chhsize1==1;
replace cothers1=0 if cothers1==. & chhsize1==1;
replace cchldrn1=0 if cchldrn1==. & chhsize1==1;

sum chhsize1 cspouse1 cparnts1 cothers1 cchldrn1;

*************************************/ ;
* Asset variables;

sum anyasst1 amtasst1 asfall1 asrise1 aamtfll1 aamtrse1;
replace amtasst1=0 if amtasst1==. & anyasst1==0;
replace asrise1=0 if asrise==. & asfall1==1;
replace asrise1=0 if asrise==. & anyasst1==0;
replace aamtfll1=0 if aamtfll1==. & asfall1==0;
replace aamtrse1=0 if aamtrse1==. & asrise1==0;

sum anyasst1 amtasst1 asfall1 asrise1 aamtfll1 aamtrse1;

*************************************/ ;
* income variables;

sum chhinc1 cpinc1 infall1 inrise1 iamtfll1 iamtrse1;

replace chhinc1=cpinc1 if chhinc1==. & chhsize1==1;
replace iamtfll1=0 if iamtfll1==. & infall1==0;
replace inrise1=0 if inrise1==. & infall1==1;
replace iamtrse1=0 if iamtrse1==. & inrise1==0;

sum chhinc1 cpinc1 infall1 inrise1 iamtfll1 iamtrse1;

*************************************/ ;
* debt variables;

sum debt1 amtdebt1 dtrise1 dtfall1 damtfll1 damtrse1;

replace amtdebt1=0 if amtdebt1==. & debt1==0;
replace dtrise1=0 if dtrise==. & debt1==0;
replace dtrise1=0 if dtrise==. & dtfall1==1;
replace damtfll1=0 if damtfll1==. & dtfall1==0;
replace damtrse1=0 if damtrse1==. & dtrise1==0;

sum debt1 amtdebt1 dtrise1 dtfall1 damtfll1 damtrse1;

*************************************/ ;
* spousal labour supply variables;

*sum cspouse1 csp_emp1 csp_hrs1;

*replace csp_emp1=0 if csp_emp1==. & cspouse1==0;
*replace csp_hrs1=0 if csp_hrs1==. & csp_emp1==0;

*sum rsp_emp1 rsp_hrs1;

replace rsp_emp1=0 if rsp_emp1==2;
*replace rsp_emp1=0 if rsp_emp1==. & cspouse1==0;
*replace rsp_hrs1=0 if rsp_hrs1==. & rsp_emp1==0;

*sum cspouse1 csp_emp1 csp_hrs1 rsp_emp1 rsp_hrs1;

**************************************/ ;
* other household members labour supply variables;

*replace NOTHER1=. if NOTHER1==99;
*replace NOTHER1=. if NOTHER1<0;

*sum caddemp1 caddft1;

*replace caddemp1=0 if caddemp1==. & NOTHER1==0;
*replace caddft1=0 if caddft1==. & caddemp1==0;

*sum raddemp1 raddft1;

*replace raddemp1=0 if raddemp1==. & NOTHER1==0;
*replace raddft1=0 if raddft1==. & raddemp1==0;

*sum caddemp1 caddft1 raddemp1 raddft1;

*************************************/ ;
exit;

